#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import rospy 
from geometry_msgs.msg import Point
import numpy as np

camera_point = np.zeros(3)

def callback(msg):
     
    global camera_point
    #zuobiaoxinxi
    x = msg.x
    y = msg.y
    z = msg.z
    
    camera_point = np.array([x,y,z])
    print("Received coordinates: x={},y={},z={}".format(x,y,z))
    
if __name__ == '__main__':
    rospy.init_node('c_node')
    sub2 = rospy.Subscriber('result3_topic',Point,callback)
    rate = rospy.Rate(10)
    
    while not rospy.is_shutdown():
        
        if camera_point.any():
            
            print(camera_point)
        rate.sleep()
        
    rospy.spin()
    print(camera_point)
    
    
    
    
 

